/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

/**
 *
 * @author sha
 */
@Entity
//@NamedQueries({
//  @NamedQuery(name = "Cerita.findByPropinsi", query = "SELECT c FROM Cerita c, Propinsi p where c.propinsi_id = :propinsi_id"),})
public class Cerita implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Lob
    @Column(name = "ISI_CERITA")
    private String isi_cerita;
    private String judul_cerita;
    private Long longvariabel;
    @ManyToOne
    private Users users;
    @ManyToOne
    private Propinsi propinsi;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    public Propinsi getPropinsi() {
        return propinsi;
    }

    public void setPropinsi(Propinsi propinsi) {
        this.propinsi = propinsi;
    }

    public String getIsi_cerita() {
        return isi_cerita;
    }

    public void setIsi_cerita(String isi_cerita) {
        this.isi_cerita = isi_cerita;
    }

    public String getJudul_cerita() {
        return judul_cerita;
    }

    public void setJudul_cerita(String judul_cerita) {
        this.judul_cerita = judul_cerita;
    }

    public Long getLongvariabel() {
        return longvariabel;
    }

    public void setLongvariabel(Long longvariabel) {
        this.longvariabel = longvariabel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cerita)) {
            return false;
        }
        Cerita other = (Cerita) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Cerita[ id=" + id + " ]";
    }
}
